var tasks = Domain(
  subtask("Bookmark location", 
    spec -> "Add location to bookmarks list"
  ), 
  subtask("Dismiss the alert message"
  ), 
  subtask("Fetch coupons", 
    spec -> "Fetch coupons from server via https"
  ), 
  subtask("Fetch news from server", 
    spec -> "Fetch news from server via https"
  ), 
  subtask("Fetch stored bookmarks", 
    spec -> "Load bookmarks list"
  ), 
  subtask("Filter POIs", 
    spec -> "Remover the pins that doesn\'t meet the filter criteria"
  ), 
  subtask("Load bookmarks list"
  ), 
  subtask("Load new map", 
    spec -> "Load the previously requested map"
  ), 
  subtask("Mark pin as bookmark", 
    spec -> "Change the pin icon to a star"
  ),
  subtask("Open coupon",
  	spec -> "A user opens the coupon from coupon view by tapping it"
  ),
  subtask("Process result", 
    spec -> "Process the https response from the server"
  ), 
  subtask("Remove bookmark from list"
  ), 
  subtask("Remove bookmark from local storage"
  ), 
  subtask("Remove launch screen", 
    spec -> "Fades out the launchscreen when application initialization has finished"
  ), 
  subtask("Request new map", 
    spec -> "Requests new map from google with the specified terrain"
  ), 
  subtask("Retrieve alert message"
  ), 
  subtask("Reverse geocode active location", 
    spec -> "Ask Google for information about the active location"
  ), 
  subtask("Select sharing method", 
    spec -> "An action sheet is revealed containing the different sharing methods"
  ), 
  subtask("Send fetch request", 
    spec -> "Sends a fetch request with the active location via https to server."
  ), 
  subtask("Share POI", 
    spec -> "Perform sharing the selected sharing method"
  ), 
  subtask("Show POIs", 
    spec -> "Place a pin on the map for each POI fitting the user defined filter"
  ), 
  subtask("Show alert popup"
  ), 
  subtask("Show brief information."
  ), 
  subtask("Show complete information"
  ), 
  subtask("Show complete information."
  ), 
  subtask("Show coupons", 
    spec -> "Show formatted http response from server"
  ), 
  subtask("Show default tab", 
    spec -> "Initializes and shows the default application tab specifyed by the customer"
  ), 
  subtask("Show bookmark"
  ), 
  subtask("Show hidden coupons",
  	spec -> "Shows all coupons that the user has selected to hide from the normal view."
  ),
  subtask("Show info", 
    spec -> "Shows Version number of the application, credits about the developers and contact information to the developers"
  ), 
  subtask("Show launch screen", 
    spec -> "Shows the launch screen until application initialization is finished"
  ), 
  subtask("Show news", 
    spec -> "Shows the formatted http response from the server"
  ), 
  subtask("Show reults", 
    spec -> "Show fetched POIs in the map view"
  ), 
  task("Application startup", 
    critical -> "None.",
    purpose -> "Start the application and make it ready to use",
    frequency -> "1 time per application use",
    trigger -> "Precondition: Application is not running. Trigger: User taps the application icon"
  ), 
  task("Application startup") has (subtask("Show launch screen"),subtask("Remove launch screen"),subtask("Show default tab")), 
  task("Change map terrain", 
    critical -> "None.",
    purpose -> "Let the user change the map terrain in the map view",
    frequency -> "An average of 3 timer per application use",
    trigger -> "Precondition: Map view is loaded and not conducting a search. Trigger: User chooses another terrain"
  ), 
  task("Change map terrain") has (subtask("Request new map"),subtask("load new map")), 
  task("Fetch Points Of Intrest (POI)", 
    critical -> "None since a fetch is cancelable",
    purpose -> "Fetch POIs from server",
    frequency -> "An average of 5 times per application use",
    trigger -> "Trigger 1: User requests the map view. Trigger 2: User sets a different active location."
  ), 
  task("Fetch Points Of Intrest (POI)") has (subtask("Reverse geocode location"),subtask("Send fetch request"),subtask("Process result"),subtask("Show results")), 
  task("Filter POIs", 
    critical -> "None.",
    purpose -> "Let the user filter POIs.",
    frequency -> "An average of 5 times per application use",
    trigger -> "User chooses a filter and its parameters"
  ), 
  task("Filter POIs") has (subtask("Filter POIs")), 
  task("Mark location as bookmark", 
    critical -> "Max 100 locations as bookmarks",
    purpose -> "Let the user have easy access to bookmarked locations.",
    frequency -> "An average of 1 time per application use.",
    trigger -> "Precondition: A more specific information view is loaded. Trigger: The user taps the add to bookmarks button"
  ), 
  task("Mark location as bookmark") has (subtask("Bookmark location"),subtask("Mark pin as bookmark")), 
  task("Remove a bookmark", 
    critical -> "None.",
    purpose -> "Let the user remove a previously set bookmark",
    frequency -> "A maximum of 1 time per bookmark",
    trigger -> "Precondition: The bookmarks list is loaded. Trigger: the user swipes from right to left on the table view cell."
  ), 
  task("Remove a bookmark") has (subtask("Remove bookmark from list"),subtask("Remove bookmark from local storage")), 
  task("Share POI", 
    critical -> "None.",
    purpose -> "Let the user share the selected POI.",
    frequency -> "An average of 5 times per application use.",
    trigger -> "Precondition: The more info view is loaded. Trigger: The user taps the share button"
  ), 
  task("Share POI") has (subtask("Select sharing method"),subtask("Share POI")), 
  task("Show Fetched POIs") has (subtask("Show POIs")), 
  task("Show a bookmark", 
    critical -> "None.",
    purpose -> "Let the user access a bookmark\'s information from the bookmarks list.",
    frequency -> "An average of 2 times per application use.",
    trigger -> "Precondition: The bookmarks list is loaded. Trigger: The user taps the table view cell."
  ), 
  task("Show a bookmark") has (subtask("Show bookmark")), 
  task("Show about view", 
    critical -> "None.",
    purpose -> "Show information about the application and its developers.",
    frequency -> "An average of 1 time per application use",
    trigger -> "User taps the about button."
  ), 
  task("Show about view") has (subtask("Show info")), 
  task("Show alert message", 
    critical -> "None.",
    purpose -> "Show an alert message.",
    frequency -> "An average of 3 times per application use.",
    trigger -> "Trigger: The an alert message is pushed to the message stack"
  ), 
  task("Show alert message") has (subtask("Retrieve alert message"),subtask("Show alert message"),subtask("Dismiss alert message")), 
  task("Show coupon view", 
    critical -> "None.",
    purpose -> "Let the application owner give application users application specific coupons.",
    frequency -> "An average of 2 timer per application use",
    trigger -> "The coupon tab is tapped"
  ), 
  task("Show coupon view") has (subtask("Fetch coupons"),subtask("Show coupons")), 
  task("Show bookmarks list", 
    critical -> "None.",
    purpose -> "Let the user browse previously set bookmarks.",
    frequency -> "An average of 2 times per application launch",
    trigger -> "User taps the bookmarks tab"
  ), 
  task("Show bookmarks list") has (subtask("Fetch stored bookmarks")), 
  task("Show fetched POIs", 
    critical -> "None.",
    purpose -> "Show filtered POIs",
    frequency -> "An average of 10 times per application use.",
    trigger -> "Precondition: Application has fetched POIs. Trigger 1: POI Fetch finishes. Trigger 2: User changes map view. Trigger 3: User sets a different active location. Trigger 4: User changes filter parameters"
  ), 
  task("Show news view", 
    critical -> "None.",
    purpose -> "Let the application owner show news to the application users.",
    frequency -> "An average of 1 time per application use",
    trigger -> "The news view is loaded"
  ), 
  task("Show news view") has (subtask("Fetch news from server"),subtask("Show news")), 
  task("Show pin information", 
    critical -> "None.",
    purpose -> "Show brief information about the selected POI and gives the abillity to show more specific information.",
    frequency -> "An average of 10 times per application use.",
    trigger -> "Precondition: Map pins are visible on the map view. Trigger: The user taps the map pin."
  ), 
  task("Show pin information") has (subtask("Show brief information."),subtask("Show complete information.")), 
  task("Show specific information") has (subtask("Show complete information")), 
  task("Show specific pin information", 
    critical -> "None.",
    purpose -> "Show specifig information about the selected POI.",
    frequency -> "An average of 2 times per application use",
    trigger -> "Precondition: Brif pin information is shown. Trigger: User taps the more information button."
  ),
  task("Unhide a hidden coupon",
  	critical -> "None.",
  	purpose -> "Unhide a coupon that has been previously marked as hidden so that the user can see and use it from the coupon view again.",
  	frequency -> "Less then once per application use.",
  	trigger -> "Precondition: The user is currently in the view showing hidden coupons and atleas one coupon is marked as hidden. Trigger: User taps the unhide button of the coupon."
  ),
  task("Unhide a hidden coupon") has (subtask("Show hidden coupons")),
  task("Use a coupon",
  	critical -> "The coupon has more uses left.",
  	purpose -> "A user can use the coupon at a store to get special offers.",
  	frequency -> "Less then once per application use.",
  	trigger -> "Precondition: A coupon is open for use, Trigger: The user holds up the phone to a QR reader in the store wich reads the coupon QR image"
  ),
  task("Use a coupon") has subtask("Open coupon")
)
